<?php

namespace App\Models\Customer;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

/**
 * Class CustomerRelateSkinProductable
 * @package App\Models\Customer
 * @mixin Builder
 */

class CustomerRelateSkinProductable extends Model
{
    protected $table = 'customer_relate_skin_productables';
    protected $guarded = [];

    /**
     * @param $productable_ids
     * @param $productable_type
     * @return array
     */
    public static function getProductIds($productable_ids, $productable_type)
    {
        return (new self)->whereIn('productable_id', $productable_ids)
            ->where('productable_type', $productable_type)
            ->pluck('product_id')
            ->toArray();
    }

}
